# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.RestoreTableMetadata do
  @moduledoc """
  Metadata type for the long-running operation returned by RestoreTable.

  ## Attributes

  *   `backupInfo` (*type:* `GoogleApi.BigtableAdmin.V2.Model.BackupInfo.t`, *default:* `nil`) - 
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the table being created and restored to.
  *   `optimizeTableOperationName` (*type:* `String.t`, *default:* `nil`) - If exists, the name of the long-running operation that will be used to track the post-restore optimization process to optimize the performance of the restored table. The metadata type of the long-running operation is OptimizeRestoredTableMetadata. The response type is Empty. This long-running operation may be automatically created by the system if applicable after the RestoreTable long-running operation completes successfully. This operation may not be created if the table is already optimized or the restore was not successful.
  *   `progress` (*type:* `GoogleApi.BigtableAdmin.V2.Model.OperationProgress.t`, *default:* `nil`) - The progress of the RestoreTable operation.
  *   `sourceType` (*type:* `String.t`, *default:* `nil`) - The type of the restore source.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backupInfo => GoogleApi.BigtableAdmin.V2.Model.BackupInfo.t() | nil,
          :name => String.t() | nil,
          :optimizeTableOperationName => String.t() | nil,
          :progress => GoogleApi.BigtableAdmin.V2.Model.OperationProgress.t() | nil,
          :sourceType => String.t() | nil
        }

  field(:backupInfo, as: GoogleApi.BigtableAdmin.V2.Model.BackupInfo)
  field(:name)
  field(:optimizeTableOperationName)
  field(:progress, as: GoogleApi.BigtableAdmin.V2.Model.OperationProgress)
  field(:sourceType)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.RestoreTableMetadata do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.RestoreTableMetadata.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.RestoreTableMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
